package com.bishe.supermarket.controller;

import com.bishe.supermarket.pojo.Save;
import com.bishe.supermarket.service.StoreService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpSession;
import java.util.List;

@Controller
public class SaveController {

    @Autowired
    StoreService storeService;

    @RequestMapping("save")
    public String save(HttpSession httpSession){

        List<Save> list = storeService.selectSave();
        httpSession.setAttribute("listSave",list);
        return "cangKu";
    }

    @RequestMapping("selectSave")
    public String selectSave(String name,HttpSession httpSession){

        List<Save> list = storeService.selectSaveInfo(name);

        httpSession.setAttribute("listSelect",list);
        return "selectSaveInfo";
    }
    @RequestMapping("addCom")
    public String addCom(){


        return "comAdd";
    }


}
